package com.lnsf.bookstore.web.address.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.web.address.dao.ApiAddressMapper;
import com.lnsf.bookstore.web.address.service.ApiAddressService;
import com.lnsf.bookstore.web.address.vo.ApiAddress;
import com.lnsf.bookstore.web.advertise.vo.ApiAdvertise;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ApiAddressServiceImpl implements ApiAddressService {

	@Autowired
	private ApiAddressMapper apiAddressMapper;

	@Override
	public List<ApiAddress> queryByUid(Map<String, Object> params) {
		return apiAddressMapper.selectByUid(params);
	}

	@Override
	public ApiAddress queryByObject(Integer id) {
		return apiAddressMapper.selectByPrimaryKey(id);
	}

	@Override
	public int save(ApiAddress apiAddress) {
		return apiAddressMapper.insertSelective(apiAddress);
	}

	@Override
	public int delete(Integer id) {
		return apiAddressMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int update(ApiAddress apiAddress) {
		return apiAddressMapper.updateByPrimaryKeySelective(apiAddress);
	}
}
